package com.orphan.supplier.controller;


import com.orphan.supplier.po.Back;
import com.orphan.supplier.po.Suppliergoods;
import com.orphan.supplier.po.Supplierorder;
import com.orphan.supplier.service.ISupplierorderService;

import com.orphan.supplier.vo.SupplierVo;
import io.swagger.annotations.Api;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zjm
 * @since 2021-07-14
 */
@RestController
@RequestMapping("/supplierorder")
@Api("供应商订单入口")
public class SupplierorderController {
    @Autowired
    ISupplierorderService iSupplierorderService;

    @GetMapping("/findAll")
    @ResponseBody
    public List<Supplierorder>findAll(){
        System.out.println(iSupplierorderService.findAll());

        return iSupplierorderService.findAll();
    }
    @GetMapping("/findByItem")
    public Object findByItem(Integer pageNO){
        return iSupplierorderService.findByItem(pageNO);
    }

    /**
     * 添加订单信息
     * @param supplierorder 订单信息
     */
    @PostMapping("/add")
    public Object addOrder(@RequestBody Supplierorder supplierorder) {
        iSupplierorderService.addOrder(supplierorder);
        return null;
    }
}
